/*! \file RBTreeIterator.h
 *	\brief <write description for RBTreeIterator.h>
 *
 *	created:	2010/11/23
 *	created:	23:11:2010   12:59
 *	filename: 	C:\src\tactics-engine\libs\core\impl\RBTreeIterator.h
 *	file path:	C:\src\tactics-engine\libs\core\impl
 *	file base:	RBTreeIterator
 *	file ext:	h
 *	author:		Vitalii Trubchaninov
 *				vitalii.trubchaninov@ubisoft.com
 */

#ifndef _core_RBTREEITERATOR_H_
#define _core_RBTREEITERATOR_H_

#pragma once

#include "RBTreeNode.h"

namespace tt{
namespace core{

namespace impl{

template<typename ValueType>
class RBTreeIterator
{
	typedef RBTreeIterator<ValueType> Self;
	typedef RBTreeNode<ValueType> Node;
public:
	typedef std::bidirectional_iterator_tag iterator_category;
	typedef ValueType value_type;
	typedef ptrdiff_t difference_type;
	typedef difference_type distance_type;	// retained
	typedef ValueType* pointer;
	typedef ValueType& reference;

public:
	RBTreeIterator();
	explicit RBTreeIterator(Node*);

	Self& operator++();
	Self operator++(int);
	Self& operator--();
	Self operator--(int);

	bool operator==(const Self&) const;
	bool operator!=(const Self&) const;

	ValueType& operator*();
	const ValueType& operator*() const;

 	ValueType* operator->();
 	const ValueType* operator->() const;

private:
	Node* m_node;
};

} //namespace impl

} //namespace core
} //namespace tt
#include "RBTreeIterator.inl"

#endif //_core_RBTREEITERATOR_H_